import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { LibraryPageVo, ResponseData } from "./type";

/**
 * 列表数据
 * @param data {LoginData}
 * @returns
 */

export function libraryaOptions(
  pageNum: number,
  pageSize: number,
  beginTime: string,
  endTime: string,
  taskNo: string,
  bookIndex: string
): AxiosPromise<ResponseData<LibraryPageVo>> {
  return request({
    url: `/api/v1/returnTask/taskReport/page`,
    method: "post",
    data: {
      pageNum,
      pageSize,
      beginTime,
      endTime,
      taskNo,
      bookIndex,
    },
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
}

/**
 * 导出用户
 *
 * @param queryParams
 * @returns
 */
export function exportUser(data: any) {
  return request({
    url: `/api/v1/returnTask/exportTaskReport`,
    method: "post",
    responseType: "arraybuffer",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
}
